package model

// ServiceCity 城市信息 结构体
type ServiceCity struct {
	//server.Model
	ID       uint   `json:"ID" form:"ID" gorm:"column:id;comment:"`
	Name     string `json:"name" form:"name" gorm:"column:name;comment:名称;"`
	Code     string `json:"code" form:"code" gorm:"column:code;comment:编码"`
	ParentID uint   `json:"parentId" form:"parentId" gorm:"column:parent_id;comment:上级ID"`

	Child []ServiceCity `json:"-" form:"-" gorm:"foreignKey:ParentID"`
}

// TableName ServiceCity 城市信息 表名
func (ServiceCity) TableName() string {
	return "service_city"
}

func (ServiceCity) TableComment() string {
	return "城市表"
}
